import React from 'react'

class ClickCounter extends React.Component{
  constructor(props) {
    super(props)
    // 组件状态
    this.state = {
       count: 0
    }
  }

  // 改变组件状态
  handleClick = () => {
    this.setState({
      count: this.state.count + 1
    })
  }

  render(){
    return (
      <button onClick={this.handleClick}>按钮被点击了{this.state.count}</button>
    )
  }


}

export default ClickCounter